/**
 * GlobalParamInfo.java
 * 版权所有(C) 2014
 * 创建者:cuiran 2014-5-12 下午4:04:41
 */
package com.ghyf.mplay.bean;

import com.ghyf.mplay.engine.XmlParser;
import com.ghyf.mplay.engineImpl.XmlparserImpl;
import com.ghyf.mplay.util.LogUtil;
import com.ghyf.mplay.value.ConstantValue;




/**
 * 主程序参数配置 类
 * @author cuiran
 * @version 1.0.0
 */
public class GlobalParamInfo {
	private static final String TAG="GlobalParamInfo";
	private String host;
	private String root_dir;
	private String out_resolution;
	private int monitor_port;
	private int data_port;
	private String live_url;
	private String screen_control_port;
	private int watchdog_interval;
	private String start_time;
	private String end_time;
	private String line_code;
	private String station_code;
	private String station_area_code;
	private String device_code;
	
	private String log_dir;
	private String log_host;
	private String log_type;
	private int log_day;
	private String log_version;
	private int upload_interval;
	private String charset;
	/**串口号 默认2*/
	private int serial=2;
	/**
	 * 控制器总音量
	 */
	private int volume=0;
	
	private static XmlParser parser=null;
	
	private static GlobalParamInfo paramInfo=null;
	
	public static GlobalParamInfo getInstance(){
		if(paramInfo==null){
			paramInfo=readGlobaParam();
		}
		return paramInfo;
	}
	
	private static GlobalParamInfo readGlobaParam(){
		
		GlobalParamInfo info=null;
		
		parser=new XmlparserImpl();
		
		try {
			
			info=parser.parseGlobalParam(ConstantValue.GLOBAL_PARAM);
			
		} catch (Exception e) {
			info=null;
			LogUtil.e(TAG,"readGlobaParam",e);
		}
		
		
		return info;
	}
	
	public GlobalParamInfo() {
		super();
	}

	
	
	/**
	 * @return the charset
	 */
	public String getCharset() {
		return charset;
	}

	/**
	 * @param charset the charset to set
	 */
	public void setCharset(String charset) {
		this.charset = charset;
	}

	/**
	 * @return the volume
	 */
	public int getVolume() {
		return volume;
	}

	/**
	 * @param volume the volume to set
	 */
	public void setVolume(int volume) {
		this.volume = volume;
	}

	/**
	 * @return the root_dir
	 */
	public String getRoot_dir() {
		return root_dir;
	}
	/**
	 * @param root_dir the root_dir to set
	 */
	public void setRoot_dir(String root_dir) {
		this.root_dir = root_dir;
	}
	/**
	 * @return the log_dir
	 */
	public String getLog_dir() {
		return log_dir;
	}
	/**
	 * @param log_dir the log_dir to set
	 */
	public void setLog_dir(String log_dir) {
		this.log_dir = log_dir;
	}
	/**
	 * @return the host
	 */
	public String getHost() {
		return host;
	}
	/**
	 * @param host the host to set
	 */
	public void setHost(String host) {
		this.host = host;
	}
	/**
	 * @return the out_resolution
	 */
	public String getOut_resolution() {
		return out_resolution;
	}
	/**
	 * @param out_resolution the out_resolution to set
	 */
	public void setOut_resolution(String out_resolution) {
		this.out_resolution = out_resolution;
	}
	/**
	 * @return the monitor_port
	 */
	public int getMonitor_port() {
		return monitor_port;
	}
	/**
	 * @param monitor_port the monitor_port to set
	 */
	public void setMonitor_port(int monitor_port) {
		this.monitor_port = monitor_port;
	}
	/**
	 * @return the data_port
	 */
	public int getData_port() {
		return data_port;
	}
	/**
	 * @param data_port the data_port to set
	 */
	public void setData_port(int data_port) {
		this.data_port = data_port;
	}
	/**
	 * @return the live_url
	 */
	public String getLive_url() {
		return live_url;
	}
	/**
	 * @param live_url the live_url to set
	 */
	public void setLive_url(String live_url) {
		this.live_url = live_url;
	}
	/**
	 * @return the screen_control_port
	 */
	public String getScreen_control_port() {
		return screen_control_port;
	}
	/**
	 * @param screen_control_port the screen_control_port to set
	 */
	public void setScreen_control_port(String screen_control_port) {
		this.screen_control_port = screen_control_port;
	}
	/**
	 * @return the watchdog_interval
	 */
	public int getWatchdog_interval() {
		return watchdog_interval;
	}
	/**
	 * @param watchdog_interval the watchdog_interval to set
	 */
	public void setWatchdog_interval(int watchdog_interval) {
		this.watchdog_interval = watchdog_interval;
	}
	/**
	 * @return the start_time
	 */
	public String getStart_time() {
		return start_time;
	}
	/**
	 * @param start_time the start_time to set
	 */
	public void setStart_time(String start_time) {
		this.start_time = start_time;
	}
	/**
	 * @return the end_time
	 */
	public String getEnd_time() {
		return end_time;
	}
	/**
	 * @param end_time the end_time to set
	 */
	public void setEnd_time(String end_time) {
		this.end_time = end_time;
	}
	
	/**
	 * @return the line_code
	 */
	public String getLine_code() {
		return line_code;
	}
	/**
	 * @param line_code the line_code to set
	 */
	public void setLine_code(String line_code) {
		this.line_code = line_code;
	}
	/**
	 * @return the station_code
	 */
	public String getStation_code() {
		return station_code;
	}
	/**
	 * @param station_code the station_code to set
	 */
	public void setStation_code(String station_code) {
		this.station_code = station_code;
	}
	/**
	 * @return the station_area_code
	 */
	public String getStation_area_code() {
		return station_area_code;
	}
	/**
	 * @param station_area_code the station_area_code to set
	 */
	public void setStation_area_code(String station_area_code) {
		this.station_area_code = station_area_code;
	}
	/**
	 * @return the device_code
	 */
	public String getDevice_code() {
		return device_code;
	}
	/**
	 * @param device_code the device_code to set
	 */
	public void setDevice_code(String device_code) {
		this.device_code = device_code;
	}
	/**
	 * @return the log_version
	 */
	public String getLog_version() {
		return log_version;
	}
	/**
	 * @param log_version the log_version to set
	 */
	public void setLog_version(String log_version) {
		this.log_version = log_version;
	}
	/**
	 * @return the log_host
	 */
	public String getLog_host() {
		return log_host;
	}
	/**
	 * @param log_host the log_host to set
	 */
	public void setLog_host(String log_host) {
		this.log_host = log_host;
	}
	/**
	 * @return the log_type
	 */
	public String getLog_type() {
		return log_type;
	}
	/**
	 * @param log_type the log_type to set
	 */
	public void setLog_type(String log_type) {
		this.log_type = log_type;
	}
	/**
	 * @return the log_day
	 */
	public int getLog_day() {
		return log_day;
	}
	/**
	 * @param log_day the log_day to set
	 */
	public void setLog_day(int log_day) {
		this.log_day = log_day;
	}
	/**
	 * @return the upload_interval
	 */
	public int getUpload_interval() {
		return upload_interval;
	}
	/**
	 * @param upload_interval the upload_interval to set
	 */
	public void setUpload_interval(int upload_interval) {
		this.upload_interval = upload_interval;
	}

	/**
	 * @return the serial
	 */
	public int getSerial() {
		return serial;
	}

	/**
	 * @param serial the serial to set
	 */
	public void setSerial(int serial) {
		this.serial = serial;
	}

	
	
	
}
